package com.coderman.infosys.auth.adapter.controller.authority;

import com.coderman.infosys.auth.adapter.controller.BaseController;
import com.coderman.infosys.auth.app.command.AuthToRoleCmd;
import com.coderman.infosys.auth.app.executor.RoleAuthCmdExe;
import com.coderman.infosys.plat.auth.common.behavior.AuthorityOpEnum;
import com.coderman.infosys.plat.auth.common.dto.ResultDataDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.coderman.infosys.auth.adapter.vo.authority.AuthorityVO;
import com.coderman.infosys.auth.adapter.vo.authority.request.CreateAuthorityRequestVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;


/**
* @Description:控制层
* @Author:
* @CreateTime:2022-01-04 15:27:39
* @version v1.0
*/
@RestController
public class AuthorityController extends BaseController {
	
	protected Logger logger = LoggerFactory.getLogger(AuthorityController.class);

	@Autowired
	private RoleAuthCmdExe roleAuthCmdExe;

	/**
	 *
	 * @Description 给角色授权
	 * @param createAuthorityRequestDTO
	 * @return AuthorityVO
	 */
	@RequestMapping(value = "/authority/savetorole")
	public ResultDataDto<AuthorityVO> saveAuthority(@RequestBody CreateAuthorityRequestVO createAuthorityRequestDTO){

		//todo param Check
		/*AuthToRoleCmd addRoleAuthCmd = AuthToRoleCmd.buildCmd(createAuthorityRequestDTO);
		return roleAuthCmdExe.exe(AuthorityOpEnum.CREATE_AUTH_TO_ROLE,addRoleAuthCmd);
		*/
		return null;
	}
}
